{extend name="_public/table_page" /}

{block name="search-form"}
<div class="layui-row">
    <form class="layui-form layui-col-md12 we-search" action="{:request()->url()}" method="get">



    </form>
</div>
{/block}
{block name="button"}
<div class="weadmin-block" style="overflow: hidden">
    {if auth("$classuri/del")}
    <button class="layui-btn layui-btn-xs" data-post-batch='{:url("$classuri/del")}' data-title="批量删除">批量删除</button>
    {/if}
    <button class="layui-btn layui-btn-xs" data-modal='{:url("$classuri/add")}' data-title="添加分类">添加轮播图</button>

</div>
{/block}

{block name="table"}
<table class="layui-table" lay-even lay-skin="line" lay-size="sm">
    <thead>
    <tr>
        <th>
            <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
        </th>
        <th>id</th>



        <th>图片</th>
        <th>跳转地址</th>
        <th>添加时间</th>
        <th>操作</th>
    </thead>
    <tbody>
    {volist name="list" id="vo"}
    <tr style="background-color: white;">
        <td>
            <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$vo.id}'><i class="layui-icon">&#xe605;</i></div>
        </td>
        <td>{$vo.id}</td>

        <td><img src="{$vo.banner}" class="data-tips-image" alt=""></td>
        <td>{$vo.url}</td>
        <td>{$vo.create_time|date='Y-m-d H:i:s'}</td>
        <td>


            {if auth("$classuri/edit")}
            <button class="layui-btn layui-btn-xs" href="javascript:;" data-title="编辑文章"
                    data-modal='{:url("$classuri/edit",["id"=>$vo.id])}&'>
                编辑
            </button>
            {/if}
            <button class="layui-btn layui-btn-xs" href="javascript:;"
                    data-confirm="确定要删除吗！" data-post='{:url("$classuri/del")}' data-param='ids={$vo.id}'>
                删除
            </button>

        </td>
    </tr>
    {/volist}
    </tbody>
</table>
{$page|raw}
<script>
    var audios = document.getElementsByTagName("audio");
    // 暂停函数
    function pauseAll() {
        var self = this;
        [].forEach.call(audios, function (i) {
            // 将audios中其他的audio全部暂停
            i !== self && i.pause();
        })
    }
    // 给play事件绑定暂停函数
    [].forEach.call(audios, function (i) {
        i.addEventListener("play", pauseAll.bind(i));
    })
</script>
{/block}
